/**
 * @name: PrivateRoute
 * @Description:
 * @Author: 方琦
 * @Date: 2022/8/17 11:25
 **/
import React from "react";
import { useRoutes, Navigate } from "react-router-dom";
import Login from "../pages/Login";
import Home from "../pages/Home";

// ---数据统计
import CustomerState from "../components/dataStatistics/Content/customerState";
import CustomerAnalysis from "../components/dataStatistics/Content/customerAnalysis";
import YearCurve from "../components/dataStatistics/Content/yearCurve";
import GenToGong from "../components/dataStatistics/Content/genToGong";
import DetailData from "../components/dataStatistics/Content/detailData";
import StaffTable from "../components/dataStatistics/Content/detailData/staffTable";
import DepartTable from "../components/dataStatistics/Content/detailData/departTable";
import Staffline from "../components/dataStatistics/Content/genToGong/staffline";
import Departline from "../components/dataStatistics/Content/genToGong/departline";
//  ---数据统计
//  ---客户公海
import CusManage from "../components/customerhighSeas/CustomerSeasM";
import PendingAudit from "../components/customerhighSeas/PendingAudit";
import ExportData from "../components/customerhighSeas/ExportData";
//  ---客户公海
// --售后统计
import After from "./AfterSales/After";
import Processed from "./AfterSales/Processed";
import Processing from "./AfterSales/Processing";
import Untreated from "./AfterSales/Untreated";
import Mystarted from "./workorder/Mystarted";
import WorkList from "./workorder/WorkList";
import Myjoin from "./workorder/Myjoin";
import Header from "./StaffManage/Header";
import DepartmentSettings from "../pages/StaffManage/DepartmentSettings";
import RolePermissions from "../pages/StaffManage/RolePermissions";
import NewEmployees from "../pages/StaffManage/NewEmployees";
import EmployeeList from "../pages/StaffManage/EmployeeList";
// --售后统计

export default function PrivateRoute() {
  return useRoutes([
    {
      path: "/",
      element: <Login />,
    },
    {
      path: "/home",
      element: <Home />,
      children: [
        // --数据统计路由
        {
          path: "cusState",
          element: <CustomerState />,
        },
        {
          path: "cusAnalysis",
          element: <CustomerAnalysis />,
        },
        {
          path: "genToGong",
          element: <GenToGong />,
          children: [
            {
              path: "staffline",
              element: <Staffline />,
            },
            {
              path: "departline",
              element: <Departline />,
            },
            {
              path: "",
              element: <Navigate to="staffline" />,
            },
          ],
        },
        {
          path: "yearCurve",
          element: <YearCurve />,
        },
        {
          path: "detailData",
          element: <DetailData />,
          children: [
            {
              path: "staffTable",
              element: <StaffTable />,
            },
            {
              path: "departTable",
              element: <DepartTable />,
            },
            {
              path: "",
              element: <Navigate to="staffTable" />,
            },
          ],
        },
        // --数据统计路由

        //客户管理
        //--员工管理
        {
          path: "staffManage",
          element: <Header />,
        },
        {
          path: "departmentSettings",
          element: <DepartmentSettings />,
        },
        {
          path: "rolePermissions",
          element: <RolePermissions />,
        },
        {
          path: "employeeList",
          element: <EmployeeList />,
        },
        {
          path: "newEmployees",
          element: <NewEmployees />,
        },
        // --客户公海路由
        {
          path: "cusManage",
          element: <CusManage />,
        },
        {
          path: "pendingAudit",
          element: <PendingAudit />,
        },
        {
          path: "exportData",
          element: <ExportData />,
        },
        // --客户公海路由

        // --售后统计路由
        {
          path: "After",
          element: <After />,
        },
        {
          path: "Processed",
          element: <Processed />,
        },
        {
          path: "Processing",
          element: <Processing />,
        },
        {
          path: "Untreated",
          element: <Untreated />,
        },
        // --售后统计路由
        //工单管理
        {
          path: "worklist",
          element: <WorkList />,
        },
        {
          path: "Mystarted",
          element: <Mystarted />,
        },
        {
          path: "Myjoin",
          element: <Myjoin />,
        },
      ],
    },
  ]);
}
